// 最大公约数
var gcd = function (min, max) {
  return max === 0 ? min : gcd(max, min % max)
}
var solution = function (nums) {
  let min = Infinity
  let max = -Infinity
  for (let num of nums) {
    if (num > max) max = num
    if (num < min) min = num
  }

  return gcd(min, max)
}

// 最大公倍数
